
define([
           "dojo/dom-construct"
       ],

    function(domConstruct)
    {
        return function(iconName, iconUrl, w, h){

            var self = this;
            this.imageUrl = iconUrl;
            this.name = iconName;
            this.size = [w, h];

            this._mouseDown = false;

            var iconContainerNode = domConstruct.create("div");
            iconContainerNode.className = "dashboardIcon unselectable";

            var iconImageNode = domConstruct.create("img");
            var iconNameNode = domConstruct.create("span");
            iconNameNode.innerHTML = iconName;
            iconImageNode.src = iconUrl;


            iconContainerNode.style.width = w + "px";
            iconContainerNode.style.height = h + "px";

            iconImageNode.style.width = "auto";
            iconImageNode.style.height = (h-10) + "px";
            iconImageNode.className = "unselectable";

            iconContainerNode.appendChild(iconImageNode);
            iconContainerNode.appendChild(iconNameNode);

            this.domNode = iconContainerNode;

            this.domNode.onclick = function()
            {
                if(self.onclick !== undefined){
                    self.onclick();
                }

                //alert("Tu as cliqué sur " + self.name);
            }

        }
    }
);
